/**
 * @param {string} s
 * @return {string}
 */
var replaceDigits = function (s) {
    let sArr = s.split('')
    for (let i = 1; i < s.length; i += 2) {
        sArr[i] = shift(sArr[i - 1], sArr[i])
    }
    return sArr.join('')
};

function shift(c, x) {
    return String.fromCharCode(c.charCodeAt() + (x - 0))
}

console.log(replaceDigits("a1b2c3d4e"))